package com.ny.baoxian;

public class Chexian extends Baoxian {
    private int n;
    private double jiage;
    private double money;

    public Chexian(int n,double jiage){
        this.n = n;
        this.jiage = jiage;
    }
    public double add(){
        if(n==0){
            money =jiage*0.02;
}
        if(n==1){
            money = jiage*0.02*1.1;
        }
        if(n>1){
            money = jiage*0.02*1.2;
        }
        return money;
    }

}
